package com.techysky.util;

import java.io.IOException;
import java.io.Serializable;

public class FileDesk implements Serializable{

	/**
	 * rundll32 url.dll FileProtocolHandler file://notepad.exe
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static void openFileUrl(String path) {    
		   final Runtime runtime = Runtime.getRuntime();       
		    final String cmd = "rundll32 url.dll FileProtocolHandler file://"+path+"";    
		    try {    
		        runtime.exec(cmd);    
		    } catch (final Exception e) {    
		        System.out.println("Error exec!");    
		    }  
		}
	
	public static void runTimeSystem(String path) {    
		   final Runtime runtime = Runtime.getRuntime();       
		    final String cmd = "rundll32 url.dll FileProtocolHandler "+path+"";    
		    try {    
		        runtime.exec(cmd);    
		    } catch (final Exception e) {    
		        System.out.println("Error exec!");    
		    }  
		}
	
	public static void executeCmd(String command) throws IOException {  
	
		Runtime.getRuntime().exec("cmd /c start \" \" \""+command+"\"");
		System.out.println("cmd /c start \" \" \""+command+"\"");
	}  
}
